
define program-variables
	$1_sources = $(filter %.c,$2)
	$1_headers = $(filter %.h,$2)
	$1_objects = $(subst .c,.o,$(filter %.c,$2))
#	$1_objects = $$(subst .c,.o,$$($1_sources))
endef

$(eval $(call program-variables,ls,ls.c ls.h glob.c glob.h))

show-variables:
		# $(ls_sources)
		# $(ls_headers)
		# $(ls_objects)
